#include "random.h"

#include "boost/random.hpp"
#include <boost/date_time/posix_time/posix_time.hpp>
#include <time.h>

static auto RANDOMSEED = time(NULL);

int random_between(int32_t start, int32_t end)
{
	boost::posix_time::ptime time = boost::posix_time::microsec_clock::local_time();
	boost::posix_time::time_duration duration(time.time_of_day());

	boost::mt19937 gen(duration.total_nanoseconds() + RANDOMSEED);
	boost::uniform_int<> dist(start, end);

	boost::variate_generator<boost::mt19937, boost::uniform_int<> > die(gen, dist);

	return RANDOMSEED = die();
}
